package com.quo.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.DeleteMapping;

import com.quo.dto.QuoDto;
import com.quo.dto.QuoInfo;
import com.quo.dto.QuotesDto;
import com.quo.entity.Order;
import com.quo.entity.QuoDetail;
import com.quo.entity.Quote;
import com.quo.entity.QuoteDetail;

/** 

* @author 韩宛廷

*/
@Mapper
public interface OrderMapper {


	@Select("select so.qid,so.abstr,q.qdate,q.totalamount,c.cname,qs.qsname,e.ename from  sorder so left join quote q on so.qid=q.qid"
			+ "  left join customer c on q.cid=c.cid left join qstatus qs on q.qsid=qs.qsid left join"
			+ "  emp e on q.ceno=e.eno  order by so.qid desc")
	List<Order> getOrderList();
	
	
//
//	@Select("select q.qid,q.qdate,q.abst,q.totalamount,q.payment,q.expiry,q.edd,qs.qsname,e.ename,c.cid,c.cname,c.address,"
//			+ "c.zip,c.tel,c.contact,c.email,c.fax from quote q left join "
//			+ "qstatus qs on q.qsid=qs.qsid left join emp e on q.ceno=e.eno left join customer c "
//			+ "on q.cid=c.cid where qid=#{qid}")
//	QuoDto getQuoDto(Long qid);
//
//	/*@Insert("Insert into quote(qdate,abst,payment,expiry,edd,cid,totalamount,ceno) values(#{qdate},#{abst},"
//			+ "#{payment},#{expiry},#{edd},#{cid},#{totalamount},#{ceno})")*/
//	void addQuote(Quote quote);
//
//	/*@Insert("Insert into quotedetail(pid,tax,discount,payment,quantity,pname,ptype,pseries,price,pstatus,qid) "
//			+ "values(#{pid},#{tax},#{discount},#{payment},#{quantity},#{pname},#{ptype},#{pseries},#{price},"
//			+ "#{pstatus},#{qid})")*/
//	void addQuoteDetail(QuoteDetail qd);
//
//	void addAllQuoteDetail(List<QuoteDetail> quoteDetailList);
//
//	@Select("select q.qid,q.abst,q.qdate,q.totalamount,c.cname,qs.qsname,e.ename from quote q "
//			+ "left join customer c on q.cid=c.cid left join qstatus qs on q.qsid=qs.qsid left join "
//			+ "emp e on q.ceno=e.eno where eno=#{eno}")
//	List<QuotesDto> getQuoteListForSelf(Integer eno);
//
//	/*@Delete("delete q.*,qd.* from quote q left join quotedetail qd on q.qid=qd.qid where qid=#{qid}")
//	Boolean delQuoInfo(Long qid);*/
//
//	@Delete("delete from quote where qid=#{qid}")
//	void delQuote(Long qid);
//
//	@Delete("delete from quotedetail where qid=#{qid}")
//	void delQuoteDetail(Long qid);
//	
//	@Select("select pid,pname,quantity,discount,price from quotedetail where qid=#{qid}")
//	List<QuoDetail> getQuoDetailList(Long qid);
//
//	//获取特定报价单信息（个人）
//	@Select("select q.qid,q.qdate,q.abst,q.totalamount,q.payment,q.expiry,q.edd,qs.qsname,e.ename,c.cid,c.cname,c.address,"
//			+ "c.zip,c.tel,c.contact,c.email,c.fax from quote q left join "
//			+ "qstatus qs on q.qsid=qs.qsid left join emp e on q.ceno=e.eno left join customer c "
//			+ "on q.cid=c.cid where qid=#{qid} and eno=#{eno}")
//	QuoDto getQuoDtoForSelf(@Param("qid")Long qid, @Param("eno")Integer eno);

}